home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp95
/
gnuchess.arc
/
hp95.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-16
|
1KB
|
77 lines
# if defined(MSDOS)
# include <dos.h>
# else
# define cdecl
# define far
# endif
# include "hp95.h"
struct font_map {
G_AREA g_area;
char g_bits[5];
};
struct font_map ascii_bitmaps[] = {
# include "ascii3x5.bm"
};
void
G_Mode(mode)
int mode;
{
# if defined(MSDOS)
union REGS regs;
union REGS oregs;
regs.h.ah = 0;
regs.h.al = mode;
int86(0x5f, ®s, &oregs);
# endif
}
void
G_ImagePut(x, y, ptr, mode)
int x;
int y;
char *ptr;
int mode;
{
# if defined(MSDOS)
union REGS regs;
union REGS oregs;
struct SREGS sregs;
regs.h.ah = 0x0e;
regs.h.al = mode;
regs.x.cx = x;
regs.x.dx = y;
regs.x.di = FP_OFF(ptr);
sregs.es = FP_SEG(ptr);
int86x(0x5f, ®s, &oregs, &sregs);
# endif
}
/**********************************************************************/
/* Function to draw a string in the 3x5 ASCII font. */
/**********************************************************************/
void
draw_small_string(x, y, str)
int x, y;
char *str;
{ int ch;
while (*str) {
ch = *str & 0xff;
if (ch == ' ')
x++;
else if (ch > ' ') {
if (ch >= 0x60)
ch -= 0x20;
ch -= ' ' + 1;
draw_bitmap(x, y, &ascii_bitmaps[ch]);
x += ascii_bitmaps[ch].g_area.width + 1;
}
str++;
}
}